from __future__ import print_function
a = int(input())
#a = int (a)
if a % 2 == 0 and 4 < a <= 12:
    print("1 ",end='')
else:
    print("0 ",end='')
if a % 2 == 0 or 4 < a <= 12:
    print("1 ",end='')
else:
    print("0 ",end='')
if ((a % 2 == 0) and not(4 < a <= 12)) or (not(a % 2 == 0) and (4 < a <= 12)):
    print("1 ",end='')
else:
    print("0 ",end='')
if not(a % 2 == 0 or 4 < a <= 12):
    print("1",end='')
else:
    print("0",end='')
